/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.uha.ensisa.kfetmanager.customer;

import fr.uha.ensisa.kfetmanager.category.CustomerCategory;
import fr.uha.ensisa.kfetmanager.product.Product;
import java.util.Iterator;
import java.util.List;
import javax.ejb.Remote;

/**
 *
 * @author JC
 */
@Remote
public interface CustomerManagerRemote {
    // Operations on the accounts
    public Customer createCustomer(
            Customer customer,
            String firstName,
            String lastName,
            String nickname,
            boolean cotisant,
            boolean gerantKfet,
            double balance,
            CustomerCategory category
            );

     public Customer updateCustomer(
            Customer customer,
            String firstName,
            String lastName,
            String nickname,
            boolean cotisant,
            boolean gerantKfet,
            CustomerCategory category
            );

    public void deleteCustomer(Customer customer);

    // Accessors
    public Customer getCustomer(Long id);
    public List<Customer> getCustomers();
    public Iterator<Customer> iterator();

   
    public Customer buyProduct(Customer customer, Product product) throws Exception;
    public Customer buyProduct(Customer customer, Product product, int quantity) throws Exception;
    public Customer creditAccount(Customer customer, double amount);

    List<Customer> getCustomers(String nicknameFilter);

    public abstract boolean exists(String nickname);

}
